.rc-cascader {
  font-size: 12px;

  &-dropdown {
    position: absolute;
    // Required, otherwise the portal that the popup is shown in will render under other components
    z-index: 9999;

    &-hidden {
      display: none;
    }
  }

  &-menus {
    //font-size: 12px;
    overflow: hidden;
    background: $page-bg;
    border: $panel-border;
    border-radius: $border-radius;
    box-shadow: $typeahead-shadow;
    white-space: nowrap;

    &.slide-up-enter,
    &.slide-up-appear {
      animation-duration: 0.3s;
      animation-fill-mode: both;
      transform-origin: 0 0;
      opacity: 0;
      animation-timing-function: cubic-bezier(0.08, 0.82, 0.17, 1);
      animation-play-state: paused;
    }

    &.slide-up-enter.slide-up-enter-active.rc-cascader-menus-placement,
    &.slide-up-appear.slide-up-appear-active.rc-cascader-menus-placement {
      &-bottomLeft {
        animation-name: SlideUpIn;
        animation-play-state: running;
      }

      &-topLeft {
        animation-name: SlideDownIn;
        animation-play-state: running;
      }
    }

    &.slide-up-leave {
      animation-duration: 0.3s;
      animation-fill-mode: both;
      transform-origin: 0 0;
      opacity: 1;
      animation-timing-function: cubic-bezier(0.6, 0.04, 0.98, 0.34);
      animation-play-state: paused;

      &.slide-up-leave-active.rc-cascader-menus-placement {
        &-bottomLeft {
          animation-name: SlideUpOut;
          animation-play-state: running;
        }

        &-topLeft {
          animation-name: SlideDownOut;
          animation-play-state: running;
        }
      }
    }
  }

  &-menu {
    display: inline-block;
    /* width: 100px; */
    max-width: 50vw;
    height: 192px;
    list-style: none;
    margin: 0;
    padding: 0;
    border-right: $panel-border;
    overflow: auto;

    &:last-child {
      border-right: 0;
    }

    &-item {
      height: 32px;
      line-height: 32px;
      padding: 0 2.5em 0 16px;
      cursor: pointer;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      transition: all 0.3s ease;
      position: relative;

      &:hover {
        background: $colors-action-hover;
      }

      &-disabled {
        cursor: not-allowed;
        color: $text-color-weak;

        &:hover {
          background: transparent;
        }

        &:after {
          position: absolute;
          right: 12px;
          content: 'loading';
          color: $text-color-weak;
          font-style: italic;
        }
      }

      &-active {
        color: $text-color-strong;
        background: $colors-action-selected;

        &:hover {
          background: $colors-action-hover;
        }
      }

      &-expand {
        position: relative;

        &:after {
          content: '>';
          font-size: 12px;
          color: $text-color-weak;
          position: absolute;
          right: 16px;
          top: 0;
          line-height: 32px;
        }
      }
    }
  }
}

@keyframes SlideUpIn {
  0% {
    opacity: 0;
    transform-origin: 0% 0%;
    transform: scaleY(0.8);
  }

  100% {
    opacity: 1;
    transform-origin: 0% 0%;
    transform: scaleY(1);
  }
}

@keyframes SlideUpOut {
  0% {
    opacity: 1;
    transform-origin: 0% 0%;
    transform: scaleY(1);
  }

  100% {
    opacity: 0;
    transform-origin: 0% 0%;
    transform: scaleY(0.8);
  }
}

@keyframes SlideDownIn {
  0% {
    opacity: 0;
    transform-origin: 0% 100%;
    transform: scaleY(0.8);
  }

  100% {
    opacity: 1;
    transform-origin: 0% 100%;
    transform: scaleY(1);
  }
}

@keyframes SlideDownOut {
  0% {
    opacity: 1;
    transform-origin: 0% 100%;
    transform: scaleY(1);
  }

  100% {
    opacity: 0;
    transform-origin: 0% 100%;
    transform: scaleY(0.8);
  }
}
